package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId      int    `gorm:"type:int(11);comment:用户Id"`
	GoodsId     int    `gorm:"type:int(11);comment:商品Id"`
	GoodsNumber string `gorm:"type:varchar(50);comment:商品编号"`
	GoodsTitle  string `gorm:"type:varchar(50);comment:商品标题"`
	GoodsPrice  int    `gorm:"type:int(11);comment:商品价格"`
	GoodsStatus int    `gorm:"type:int(1);comment:商品状态"`
	GoodsCover  string `gorm:"type:varchar(255);comment:商品封面"`
	GoodsTypes  int    `gorm:"type:int(2);comment:商品类型"`
}

func (c *Order) AddOrder() error {
	return Db.Create(&c).Error
}
